Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain the default panic hook better #108105

Merged
merged 1 commit into from
Feb 21, 2023
Merged

Explain the default panic hook better #108105

merged 1 commit into from
Feb 21, 2023

Conversation

majaha
Copy link
Contributor

@majaha majaha commented Feb 16, 2023

This changes the documentation of std::panic::set_hook and take_hook to explain how the default panic hook works. In particular the fact that take_hook registers the default hook, rather than no hook at all, was missing from the docs.

I also reworded a few things for clarity.

@rustbot
Copy link
Collaborator

rustbot commented Feb 16, 2023

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @cuviper (or someone else) soon.

Please see the contribution instructions for more information.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Feb 16, 2023
@majaha majaha marked this pull request as ready for review February 16, 2023 01:05
@rustbot
Copy link
Collaborator

rustbot commented Feb 16, 2023

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

Copy link
Member

@cuviper cuviper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a typo:

library/std/src/panicking.rs Outdated Show resolved Hide resolved
@majaha
Copy link
Contributor Author

majaha commented Feb 20, 2023

Thanks, I've fixed it. Are the commits fine as-is, or would you prefer I squashed the typo commits into the first commit?

@cuviper
Copy link
Member

cuviper commented Feb 20, 2023

If you're willing and able to squash, that's a little nicer, but it's not a big deal either way.

This changes the documentation of `std::panic::set_hook` and `take_hook` to better explain how the default panic hook works. In particular the fact that `take_hook` registers the default hook, rather than no hook at all, was missing from the docs.
@majaha
Copy link
Contributor Author

majaha commented Feb 20, 2023

Okay, commits squashed. I also changed this line:
/// If no custom hook is registered, the default hook will be returned (but remain registered).
->
/// If the default hook is registered it will be returned, but remain registered.

@cuviper
Copy link
Member

cuviper commented Feb 20, 2023

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Feb 20, 2023

📌 Commit ec9a4ce has been approved by cuviper

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 20, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 21, 2023
Rollup of 7 pull requests

Successful merges:

 - rust-lang#108000 (lint: don't suggest MaybeUninit::assume_init for uninhabited types)
 - rust-lang#108105 (Explain the default panic hook better)
 - rust-lang#108141 (Add rpitit queries)
 - rust-lang#108272 (docs: wrong naming convention in struct keyword doc)
 - rust-lang#108285 (remove unstable `pick_stable_methods_before_any_unstable` flag)
 - rust-lang#108289 (Name placeholder in some region errors)
 - rust-lang#108290 (Add a test for default trait method with RPITITs)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit e781a6f into rust-lang:master Feb 21, 2023
@rustbot rustbot added this to the 1.69.0 milestone Feb 21, 2023
@majaha majaha deleted the patch-1 branch February 22, 2023 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants